import 'lift_info.dart';

class NotificationInfo{
  String buildId = "";
  ///报警序号 0~31,EP PUS PUW 为-1
  int alermOrder = -1;
  ///警报信息
  String alerm = "";
  ///类型 alerm 0，ep 1，pus 2，3 puw
  int type = 0;

  String liftName ="";
  int liftOrder =-1;
  String buildNumber = "";


  NotificationInfo(this.buildId, this.alermOrder, this.alerm, this.type,
      this.liftName, this.liftOrder,this.buildNumber);

  String getKey() {
    return "${buildId}_${liftOrder}_${liftName}_$alerm";
  }

  String getContent() {
    StringBuffer contentBuffer = StringBuffer();
    contentBuffer.write("$buildNumber:$liftName $alerm");
    return contentBuffer.toString();
  }

  Map<String, dynamic> toJson() => {"buildId": buildId, "alermOrder": alermOrder, "alerm": alerm, "type": type, "liftName": liftName, "liftOrder": liftOrder};

  @override
  String toString() {
    return 'NotificationInfo{buildId: $buildId, alermOrder: $alermOrder, alerm: $alerm, type: $type, liftName: $liftName, liftOrder: $liftOrder}';
  }

  static String getLiftKey(String buildId, String liftName, int liftOrder) {
    return "${buildId}_${liftOrder}_${liftName}_";
  }
}
